3.2.50 \(\int \sqrt {a+a \sec (e+f x)} (c+d \sec (e+f x)) \, dx\) [150]

Optimal. Leaf size=66 \[ \frac {2 \sqrt {a} c \text {ArcTan}\left (\frac {\sqrt {a} \tan (e+f x)}{\sqrt {a+a \sec (e+f x)}}\right )}{f}+\frac {2 a d \tan (e+f x)}{f \sqrt {a+a \sec (e+f x)}} \]

[Out]

2*c*arctan(a^(1/2)*tan(f*x+e)/(a+a*sec(f*x+e))^(1/2))*a^(1/2)/f+2*a*d*tan(f*x+e)/f/(a+a*sec(f*x+e))^(1/2)

________________________________________________________________________________________

Rubi [A]
time = 0.06, antiderivative size = 66, normalized size of antiderivative = 1.00, number of steps used = 4, number of rules used = 4, integrand size = 25, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.160, Rules used = {4000, 3859, 209, 3877} \begin {gather*} \frac {2 \sqrt {a} c \text {ArcTan}\left (\frac {\sqrt {a} \tan (e+f x)}{\sqrt {a \sec (e+f x)+a}}\right )}{f}+\frac {2 a d \tan (e+f x)}{f \sqrt {a \sec (e+f x)+a}} \end {gather*}

Antiderivative was successfully verified.

[In]

Int[Sqrt[a + a*Sec[e + f*x]]*(c + d*Sec[e + f*x]),x]

[Out]

(2*Sqrt[a]*c*ArcTan[(Sqrt[a]*Tan[e + f*x])/Sqrt[a + a*Sec[e + f*x]]])/f + (2*a*d*Tan[e + f*x])/(f*Sqrt[a + a*S
ec[e + f*x]])

Rule 209

Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> Simp[(1/(Rt[a, 2]*Rt[b, 2]))*ArcTan[Rt[b, 2]*(x/Rt[a, 2])], x] /;
 FreeQ[{a, b}, x] && PosQ[a/b] && (GtQ[a, 0] || GtQ[b, 0])

Rule 3859

Int[Sqrt[csc[(c_.) + (d_.)*(x_)]*(b_.) + (a_)], x_Symbol] :> Dist[-2*(b/d), Subst[Int[1/(a + x^2), x], x, b*(C
ot[c + d*x]/Sqrt[a + b*Csc[c + d*x]])], x] /; FreeQ[{a, b, c, d}, x] && EqQ[a^2 - b^2, 0]

Rule 3877

Int[csc[(e_.) + (f_.)*(x_)]*Sqrt[csc[(e_.) + (f_.)*(x_)]*(b_.) + (a_)], x_Symbol] :> Simp[-2*b*(Cot[e + f*x]/(
f*Sqrt[a + b*Csc[e + f*x]])), x] /; FreeQ[{a, b, e, f}, x] && EqQ[a^2 - b^2, 0]

Rule 4000

Int[Sqrt[csc[(e_.) + (f_.)*(x_)]*(b_.) + (a_)]*(csc[(e_.) + (f_.)*(x_)]*(d_.) + (c_)), x_Symbol] :> Dist[c, In
t[Sqrt[a + b*Csc[e + f*x]], x], x] + Dist[d, Int[Sqrt[a + b*Csc[e + f*x]]*Csc[e + f*x], x], x] /; FreeQ[{a, b,
 c, d, e, f}, x] && NeQ[b*c - a*d, 0] && EqQ[a^2 - b^2, 0]

Rubi steps

\begin {align*} \int \sqrt {a+a \sec (e+f x)} (c+d \sec (e+f x)) \, dx &=c \int \sqrt {a+a \sec (e+f x)} \, dx+d \int \sec (e+f x) \sqrt {a+a \sec (e+f x)} \, dx\\ &=\frac {2 a d \tan (e+f x)}{f \sqrt {a+a \sec (e+f x)}}-\frac {(2 a c) \text {Subst}\left (\int \frac {1}{a+x^2} \, dx,x,-\frac {a \tan (e+f x)}{\sqrt {a+a \sec (e+f x)}}\right )}{f}\\ &=\frac {2 \sqrt {a} c \tan ^{-1}\left (\frac {\sqrt {a} \tan (e+f x)}{\sqrt {a+a \sec (e+f x)}}\right )}{f}+\frac {2 a d \tan (e+f x)}{f \sqrt {a+a \sec (e+f x)}}\\ \end {align*}

________________________________________________________________________________________

Mathematica [A]
time = 0.34, size = 76, normalized size = 1.15 \begin {gather*} \frac {\sec \left (\frac {1}{2} (e+f x)\right ) \sqrt {a (1+\sec (e+f x))} \left (\sqrt {2} c \text {ArcSin}\left (\sqrt {2} \sin \left (\frac {1}{2} (e+f x)\right )\right ) \sqrt {\cos (e+f x)}+2 d \sin \left (\frac {1}{2} (e+f x)\right )\right )}{f} \end {gather*}

Antiderivative was successfully verified.

[In]

Integrate[Sqrt[a + a*Sec[e + f*x]]*(c + d*Sec[e + f*x]),x]

[Out]

(Sec[(e + f*x)/2]*Sqrt[a*(1 + Sec[e + f*x])]*(Sqrt[2]*c*ArcSin[Sqrt[2]*Sin[(e + f*x)/2]]*Sqrt[Cos[e + f*x]] +
2*d*Sin[(e + f*x)/2]))/f

________________________________________________________________________________________

Maple [B] Leaf count of result is larger than twice the leaf count of optimal. \(117\) vs. \(2(58)=116\).
time = 0.17, size = 118, normalized size = 1.79

method result size
default \(-\frac {\sqrt {\frac {a \left (\cos \left (f x +e \right )+1\right )}{\cos \left (f x +e \right )}}\, \left (\sqrt {-\frac {2 \cos \left (f x +e \right )}{\cos \left (f x +e \right )+1}}\, \sqrt {2}\, \arctanh \left (\frac {\sqrt {-\frac {2 \cos \left (f x +e \right )}{\cos \left (f x +e \right )+1}}\, \sin \left (f x +e \right ) \sqrt {2}}{2 \cos \left (f x +e \right )}\right ) c \sin \left (f x +e \right )+2 d \cos \left (f x +e \right )-2 d \right )}{f \sin \left (f x +e \right )}\) \(118\)

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((c+d*sec(f*x+e))*(a+a*sec(f*x+e))^(1/2),x,method=_RETURNVERBOSE)

[Out]

-1/f*(a*(cos(f*x+e)+1)/cos(f*x+e))^(1/2)*((-2*cos(f*x+e)/(cos(f*x+e)+1))^(1/2)*2^(1/2)*arctanh(1/2*(-2*cos(f*x
+e)/(cos(f*x+e)+1))^(1/2)*sin(f*x+e)/cos(f*x+e)*2^(1/2))*c*sin(f*x+e)+2*d*cos(f*x+e)-2*d)/sin(f*x+e)

________________________________________________________________________________________

Maxima [B] Leaf count of result is larger than twice the leaf count of optimal. 159 vs. \(2 (62) = 124\).
time = 0.54, size = 159, normalized size = 2.41 \begin {gather*} \frac {\sqrt {a} c \arctan \left ({\left (\cos \left (2 \, f x + 2 \, e\right )^{2} + \sin \left (2 \, f x + 2 \, e\right )^{2} + 2 \, \cos \left (2 \, f x + 2 \, e\right ) + 1\right )}^{\frac {1}{4}} \sin \left (\frac {1}{2} \, \arctan \left (\sin \left (2 \, f x + 2 \, e\right ), \cos \left (2 \, f x + 2 \, e\right ) + 1\right )\right ) + \sin \left (f x + e\right ), {\left (\cos \left (2 \, f x + 2 \, e\right )^{2} + \sin \left (2 \, f x + 2 \, e\right )^{2} + 2 \, \cos \left (2 \, f x + 2 \, e\right ) + 1\right )}^{\frac {1}{4}} \cos \left (\frac {1}{2} \, \arctan \left (\sin \left (2 \, f x + 2 \, e\right ), \cos \left (2 \, f x + 2 \, e\right ) + 1\right )\right ) + \cos \left (f x + e\right )\right )}{f} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((c+d*sec(f*x+e))*(a+a*sec(f*x+e))^(1/2),x, algorithm="maxima")

[Out]

sqrt(a)*c*arctan2((cos(2*f*x + 2*e)^2 + sin(2*f*x + 2*e)^2 + 2*cos(2*f*x + 2*e) + 1)^(1/4)*sin(1/2*arctan2(sin
(2*f*x + 2*e), cos(2*f*x + 2*e) + 1)) + sin(f*x + e), (cos(2*f*x + 2*e)^2 + sin(2*f*x + 2*e)^2 + 2*cos(2*f*x +
 2*e) + 1)^(1/4)*cos(1/2*arctan2(sin(2*f*x + 2*e), cos(2*f*x + 2*e) + 1)) + cos(f*x + e))/f

________________________________________________________________________________________

Fricas [A]
time = 2.36, size = 256, normalized size = 3.88 \begin {gather*} \left [\frac {{\left (c \cos \left (f x + e\right ) + c\right )} \sqrt {-a} \log \left (\frac {2 \, a \cos \left (f x + e\right )^{2} - 2 \, \sqrt {-a} \sqrt {\frac {a \cos \left (f x + e\right ) + a}{\cos \left (f x + e\right )}} \cos \left (f x + e\right ) \sin \left (f x + e\right ) + a \cos \left (f x + e\right ) - a}{\cos \left (f x + e\right ) + 1}\right ) + 2 \, d \sqrt {\frac {a \cos \left (f x + e\right ) + a}{\cos \left (f x + e\right )}} \sin \left (f x + e\right )}{f \cos \left (f x + e\right ) + f}, -\frac {2 \, {\left ({\left (c \cos \left (f x + e\right ) + c\right )} \sqrt {a} \arctan \left (\frac {\sqrt {\frac {a \cos \left (f x + e\right ) + a}{\cos \left (f x + e\right )}} \cos \left (f x + e\right )}{\sqrt {a} \sin \left (f x + e\right )}\right ) - d \sqrt {\frac {a \cos \left (f x + e\right ) + a}{\cos \left (f x + e\right )}} \sin \left (f x + e\right )\right )}}{f \cos \left (f x + e\right ) + f}\right ] \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((c+d*sec(f*x+e))*(a+a*sec(f*x+e))^(1/2),x, algorithm="fricas")

[Out]

[((c*cos(f*x + e) + c)*sqrt(-a)*log((2*a*cos(f*x + e)^2 - 2*sqrt(-a)*sqrt((a*cos(f*x + e) + a)/cos(f*x + e))*c
os(f*x + e)*sin(f*x + e) + a*cos(f*x + e) - a)/(cos(f*x + e) + 1)) + 2*d*sqrt((a*cos(f*x + e) + a)/cos(f*x + e
))*sin(f*x + e))/(f*cos(f*x + e) + f), -2*((c*cos(f*x + e) + c)*sqrt(a)*arctan(sqrt((a*cos(f*x + e) + a)/cos(f
*x + e))*cos(f*x + e)/(sqrt(a)*sin(f*x + e))) - d*sqrt((a*cos(f*x + e) + a)/cos(f*x + e))*sin(f*x + e))/(f*cos
(f*x + e) + f)]

________________________________________________________________________________________

Sympy [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \int \sqrt {a \left (\sec {\left (e + f x \right )} + 1\right )} \left (c + d \sec {\left (e + f x \right )}\right )\, dx \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((c+d*sec(f*x+e))*(a+a*sec(f*x+e))**(1/2),x)

[Out]

Integral(sqrt(a*(sec(e + f*x) + 1))*(c + d*sec(e + f*x)), x)

________________________________________________________________________________________

Giac [B] Leaf count of result is larger than twice the leaf count of optimal. 193 vs. \(2 (58) = 116\).
time = 1.15, size = 193, normalized size = 2.92 \begin {gather*} -\frac {\frac {2 \, \sqrt {2} \sqrt {-a \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right )^{2} + a} a d \mathrm {sgn}\left (\cos \left (f x + e\right )\right ) \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right )}{a \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right )^{2} - a} + \frac {\sqrt {-a} a c \log \left (\frac {{\left | 2 \, {\left (\sqrt {-a} \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right ) - \sqrt {-a \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right )^{2} + a}\right )}^{2} - 4 \, \sqrt {2} {\left | a \right |} - 6 \, a \right |}}{{\left | 2 \, {\left (\sqrt {-a} \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right ) - \sqrt {-a \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right )^{2} + a}\right )}^{2} + 4 \, \sqrt {2} {\left | a \right |} - 6 \, a \right |}}\right ) \mathrm {sgn}\left (\cos \left (f x + e\right )\right )}{{\left | a \right |}}}{f} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((c+d*sec(f*x+e))*(a+a*sec(f*x+e))^(1/2),x, algorithm="giac")

[Out]

-(2*sqrt(2)*sqrt(-a*tan(1/2*f*x + 1/2*e)^2 + a)*a*d*sgn(cos(f*x + e))*tan(1/2*f*x + 1/2*e)/(a*tan(1/2*f*x + 1/
2*e)^2 - a) + sqrt(-a)*a*c*log(abs(2*(sqrt(-a)*tan(1/2*f*x + 1/2*e) - sqrt(-a*tan(1/2*f*x + 1/2*e)^2 + a))^2 -
 4*sqrt(2)*abs(a) - 6*a)/abs(2*(sqrt(-a)*tan(1/2*f*x + 1/2*e) - sqrt(-a*tan(1/2*f*x + 1/2*e)^2 + a))^2 + 4*sqr
t(2)*abs(a) - 6*a))*sgn(cos(f*x + e))/abs(a))/f

________________________________________________________________________________________

Mupad [F]
time = 0.00, size = -1, normalized size = -0.02 \begin {gather*} \int \sqrt {a+\frac {a}{\cos \left (e+f\,x\right )}}\,\left (c+\frac {d}{\cos \left (e+f\,x\right )}\right ) \,d x \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((a + a/cos(e + f*x))^(1/2)*(c + d/cos(e + f*x)),x)

[Out]

int((a + a/cos(e + f*x))^(1/2)*(c + d/cos(e + f*x)), x)

________________________________________________________________________________________